/**
 * there is a singleton of theater object only.
 * no more theater is loaded by default!
 */
var Theater =
{
	dom : 0,
	isHide : 0,
	getDom : function() {
		if (!Theater.dom)
		{
			var dom = $('<div class="uiTheaterLayer"></div').appendTo('body');
			dom.html('<div class="uiTheaterOuter"><div class="uiTheaterStage"></div></div></div>');
			dom.bind('click', function(evt) {
				var target = evt.target;
				if (!$(target).closest('.uiTheaterStage').length)
				{
					Theater.hide();
				}
			});
			Theater.dom = dom;
		}
		return Theater.dom;
	},
	open : function(json) {
		var dom = Theater.getDom();
		dom.find('.uiTheaterStage').html(json.html);
		Theater.show();
	},
	show : function() {
		Theater.dom.show();
		Theater.isHide = 0;
	},
	hide : function() {
		Theater.dom.hide();
		Theater.isHide = 1;
	}
}
nuo.theater = function(t, evt) {
	$.getJSON(_config.basePath + 'photo/ajax/theater', {'data-id':t.attr('data-id')}, Theater.open);
}
